package com.rati.usercenter.mapper;

import com.rati.usercenter.model.domain.Team;
import com.rati.usercenter.model.domain.User;
import com.rati.usercenter.model.domain.UserTeam;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author Lwh
 * @description 针对表【user_team(用户队伍关系)】的数据库操作Mapper
 * @createDate 2022-12-23 12:35:41
 * @Entity com.rati.usercenter.model.domain.UserTeam
 */
public interface UserTeamMapper extends BaseMapper<UserTeam> {

    /**
     * 根据队伍id获取成员列表
     *
     * @param teamId 队伍id
     * @return 成员列表
     */
    List<User> getMembersByTeamId(@Param("teamId") long teamId);

    /**
     * 根据用户id获取其加入的队伍列表
     *
     * @param userId 用户id
     * @return 加入的队伍列表
     */
    List<Team> getJoinTeamByUserId(@Param("userId") long userId);

}




